//
// Worm epidemic model
//
// @author Michael Liljenstam, ISTS, Dartmouth College
//
// $Id: WormEpidemic.java,v 1.1 2003/02/27 22:41:00 mili Exp $

package SSF.App.Worm;

//.............................................................
/**
 *  Worm Epidemiological model for one AS. Abstract base class for 
 *  implementations of the epidemic model.
 */
public abstract class WormEpidemic {

    // global epidemic state

    /** Total (initially susceptible) hosts. */
    int N;

    /** 'Overall' infection parameter. */
    public float Beta;
    /** Total susceptible hosts. */
    public float sTot;
    /** Total infected hosts. */
    public float iTot;
    /** Total recovered hosts. */
    public float rTot = 0;
    /** Cross-strata infection parameters. */
    public float[] BetaJ;

    /** Initializer code. (Strategy pattern) */
    public WormEpidemicInitializer initializer;

    /** Debug flag. */
    public boolean DEBUG = false;

    // Global API -------------------------------------------------

    /**
     *  Initialize epidemic model.
     */
    public void init() {
	if (initializer != null) {
	    initializer.doInit();
	} else {
	    System.err.println("ERROR: epidemic model initializer not created");
	    System.exit(-1);
	}
    }

    /**
     *  One timestep.
     */
    abstract public void update();

    /**
     *  Output state at current timestep.
     */
    abstract public void output();


} // class WormEpidemic


